package org.itboys.core.entity.mysql.order;

import lombok.Data;
import org.itboys.commons.utils.time.TimeUtils;
import org.itboys.mysql.entity.BaseMySqlEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 作者：zzq
 * 时间：2018/12/5
 * 描述：派送订单
 */
@Data
public class SundaySendOrder extends BaseMySqlEntity {
    private String orderNo;//订单号
    private Long memberId;//用户id
    private String memberName;//用户名称
    private Long serviceId;//供应商id
    private String serviceName;//供应商名称
    private String serviceMobile;//供应商电话
    private Long storeId;//仓库id
    private String storeName;//仓库名称
    private String storeAddress;//仓库地址
    private String mobile;//电话
    private Integer type;//租赁方式  1，日租  2，月租  3，季租
    private Long time;//时间  多少天  多少月
    private Integer getType;//取托方式   1.送货上门   2.租户自取
    private String getTime;//取托时间
    private Long renewTime;//续费时间  多少天  多少月
    private Integer status;//状态

    private Date sendTime;//发货时间
    private Long sendProvinceId;//送托省份id
    private String sendProvince;//送托省份
    private Long sendCityId;//送托城市id
    private String sendCity;//送托城市
    private Long sendDistrictId;//送托区域id
    private String sendDistrict;//送托区域
    private String sendAddress;//送托地址

    private Date recycleDate;//回收时间
    private Long recycleProvinceId;//回收省份id
    private String recycleProvince;//回收省份
    private Long recycleCityId;//回收城市id
    private String recycleCity;//回收城市
    private Long recycleDistrictId;//回收区域id
    private String recycleDistrict;//回收区域
    private String recycleAddress;//回收地址

    private BigDecimal  depositAmount;//押金
    private BigDecimal rentAmount;//租金
    private BigDecimal totalAmount;//总租金
    private BigDecimal payAmount;//支付金额  押金+租金

    private Integer payType;//付款方式,1支付宝，2微信
    private Date payTime;//付款时间

    private Date receiveTime;//收货时间
    private Integer invoiced;//开具发票标识：0未开具，1，已开

    public String  getStatusStr(){
        String statusStr= "";
        if(status==null)return statusStr;

        switch (status) {
            case 1:
                statusStr="待付款";
                break;
            case 2:
                statusStr="已付款";
                break;
            case 3:
                statusStr="已接单";
                break;
            case 4:
                statusStr="已发盘";
                break;
            case 5:
                statusStr="已收盘";
                break;
            case 6:
                statusStr="已到期";
                break;
            case 7:
                statusStr="已续费";
                break;
            case 8:
                statusStr="已回收";
                break;
            case 9:
                statusStr="已买断";
                break;
            case 10:
                statusStr="已冻结";
                break;
            case 11:
                statusStr="已取消";
                break;
            case 12:
                statusStr="已完成";
                break;
            default:
                break;
        }
        return statusStr;
    }


    public String  getTypeStr(){
        String typeStr= "";
        if(type==null)return typeStr;
        switch (type) {
            case 1:
                typeStr="日租";
                break;
            case 2:
                typeStr="月租";
                break;
            case 3:
                typeStr="季租";
                break;
            default:
                break;
        }
        return typeStr;
    }


    public String  getGetTypeStr(){
        String getTypeStr= "";
        if(getType==null)return getTypeStr;
        switch (getType) {
            case 1:
                getTypeStr="送货上门";
                break;
            case 2:
                getTypeStr="租户自取";
                break;
            default:
                break;
        }
        return getTypeStr;
    }


    public String getSendTimeStr() {

        return TimeUtils.format(sendTime,"yyyy-MM-dd HH:mm:ss");
    }

    public String getPayTimeStr() {

        return TimeUtils.format(payTime,"yyyy-MM-dd HH:mm:ss");
    }

    public String getReceiveTimeStr() {

        return TimeUtils.format(receiveTime,"yyyy-MM-dd HH:mm:ss");
    }


}
